home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
comm
/
_ter12b.zip
/
TER12B._XE
/
PASCAL.EXE
/
FILESBBS.PAS
next >
Wrap
Pascal/Delphi Source File
|
1993-09-23
|
4KB
|
99 lines
{
Terminate help file
The format of FILES.BBS style files are used on many BBS systems. It is
the easiest to have around since you can edit these files with any normal
texteditor.
Terminate will also internally support a description file called
DESCRIPT.ION, which is used together with 4DOS.
These files are real simple to process, because the format is:
filename.ext+space+description:
Example DESCRIPT.ION file:
------- CUT -------
TER100.ARJ The final terminal version 1.00
T-UTILS.ARJ List & Qedit, great lister and editor
------- CUT -------
The FILES.BBS file is a normal textfile, which has a #13+#10 CR+LF after
each line. The following is a sample FILES.BBS.
------- CUT -------
╒═══════════════════════════════════════════════════════════════════════════╕
│ Area #2 : TER :Terminate Access level 500 │
├───────────────────────────────────────────────────────────────────────────┤
│░░░░░▒▒▒▒▒▓▓▓▓▓█████ 1.192.915 bytes in 31 files █████▓▓▓▓▓▒▒▒▒▒░░░░░│
╘ <FAST 6.00α> (C) Bo Bendtsen ╛
TER99.ARJ [429] Latest version of terminate, MAJOR UPDATE
This program will do it all for you
HISTORY.DOC [49] Check this for new features, also in TER??.ARJ
-------- CUT -------
1 14
Filename Description
When scanning through this file you can assume that the line is a comment
if position 1 is a blank ' ' or a minus '-' then you are sure. But otherwise
you could also demand that position 1 must be in the range of 'A'..'Z', but
this method is not recommend because not all FILES.BBS programmers do the
same thing. Position 14 and the rest of the line is the description of the
file. Some programmers allow multiline descriptions, if you want to support
that, when you get a filename, just read on until a new filename is read,
the first position is minus,'',eof.
}
{ This little example will show you how to only write out files and desc. }
{DUMMY}
Program ShowFiles;
Uses Crt;
Var
S : String;
ReadNext : Boolean;
FilesBBS : Text;
FastBuffer : Array[1..8192] of Byte {or Char... does not matter};
{
8192 bytes should always be used since average size never is more than
this. Now the entire textfile will be read in one stroke.
}
Begin
ClrScr; { Clear Screen }
Filemode:=66+128; { Deny none on networks }
Assign(FilesBBS,'FILESBBS.PAS'); { Only for testing }
SetTextBuf(FilesBBS,FastBuffer); { Set big buffer for text }
{$I-} Reset(FilesBBS); {$I+} { Open the file }
S:=''; { Clean string }
If IOResult=0 Then { File open for read }
Begin
ReadNext:=True; { Need this for multi desc.}
While Not Eof(FilesBBS) And
(S<>' {DUMMY}') Do { DUMMY is just to stop }
Begin
If ReadNext Then ReadLn(FilesBBS,S);
ReadNext:=True;
If (S<>'') And { This is a file }
Not (S[1] in [' ','-']) Then
Begin
WriteLn(S); { Show first line }
ReadLn(FilesBBS,S); { Read next line }
ReadNext:=False;
While (S<>'') And (S[1]=' ')
And Not Eof(FilesBBS) Do { If more description lines}
Begin { then read and show them }
WriteLn(S);
ReadLn(FilesBBS,S);
ReadNext:=False;
End;
End;
End;
Close(FilesBBS); { Close file handle }
End
Else WriteLn('Could not open file'); { Error if not found }
End.